#ifndef GLUT_TRACKBALL_H
#define GLUT_TRACKBALL_H

#ifdef MACOS
#include <glut.h>
#else
#include <GL/glut.h>
#endif


#define LEFT_BUTTON   0
#define MIDDLE_BUTTON 1
#define RIGHT_BUTTON  2
#define WHEEL_UP      3
#define WHEEL_DOWN    4

static vcg::Trackball::Button GLUT2VCG (int glut_b)
{
  int vcg_b = vcg::Trackball::BUTTON_NONE;

  switch (glut_b)
  {
  case LEFT_BUTTON:
      vcg_b |= vcg::Trackball::BUTTON_LEFT;
      break;

  case MIDDLE_BUTTON:
      vcg_b |= vcg::Trackball::BUTTON_MIDDLE;
      break;

  case RIGHT_BUTTON:
      vcg_b |= vcg::Trackball::BUTTON_RIGHT;
      break;

  case WHEEL_UP:
  case WHEEL_DOWN:
      vcg_b = vcg::Trackball::WHEEL;
      break;
  }

/*
  if (modifiers & Qt::ShiftModifier)		vcg_b |= vcg::Trackball::KEY_SHIFT;
  if (modifiers & Qt::ControlModifier)	vcg_b |= vcg::Trackball::KEY_CTRL;
  if (modifiers & Qt::AltModifier)			vcg_b |= vcg::Trackball::KEY_ALT;
*/
  return vcg::Trackball::Button (vcg_b);
}

// int glutGetModifiers(void); - GLUT_ACTIVE_SHIFT - GLUT_ACTIVE_CTRL - GLUT_ACTIVE_ALT
// qt wheel: down -120, up +120

#endif // GLUT_TRACKBALL_H
